<?php
namespace Controller;

use Hoa\Registry\Registry;
use Library\Db;
use Library\Input;
use Library\Log;
use Library\View;
use Math\Parser as Math;
use Model\Cnf;
use Model\Test;
use Service\CnfService;
use Service\TestService;

/**
 * TestController
 * @author los_gsy
 */
class TestController extends BaseController {
	static public $table = 'test';


	/**
	 * 构造函数
	 */
	public function __construct() {
		parent::__construct();
	}


	/**
	 * test
	 */
	public function test() {
		View::display('Test/test');
	}


	/**
	 * tmp
	 */
	public function tmp() {
		$math = new Math;
// 		$expr = '1 + 2 * 3 * ( 7 * 8 ) - ( 45 - 10 )';
		$expr = '1 + 2 - 3 * 4 + 6 / 2';
		$x = 3;
		$y = 4;
		$expr = "$x * $y";
		$result = $math->evaluate($expr);

		var_export($result);
	}


	/**
	 * tmp2
	 */
	public function tmp2() {
		$conf = Registry::get('conf');
		$result = $conf['status'][200];
		var_export($result);
	}


	/**
	 * phpinfo
	 */
	public function phpinfo() {
		phpinfo();
	}


	/**
	 * getCnf
	 */
	public function getCnf() {
		$id = Input::get('id/d', 0);
		$result = TestService::getCnf($id);
		var_dump($result);
	}


	/**
	 * cookie
	 */
	public function cookie() {
		var_export($_COOKIE);
	}





}